'''
Created on May 9, 2011

@author: Miles
'''

from main.models import Achievement

class CheevoManager:
    firstblood = {'name' : 'First Blood',
                  'description' : 'You have completed your first search',
                  'points' : 5}

    sixthranger = {'name' : 'Sixth Ranger',
              'description' : 'You have added your sixth buddy',
              'points' : 10}
    
    foreveralone = {'name' : 'Forever Alone',
              'description' : 'You have removed all your friends',
              'points' : 50}
    
    lewddude = {'name' : 'Lewd Dude',
                'description' : 'You entered a lewd word in your search',
                'points' : 5}
    
    megusta = {'name' : 'Me gusta',
               'description' : 'You have added a book to your bookshelf',
               'points' : 5}
    
    stayawhile = {'name' : 'Hello, my friend. Stay awhile and listen...',
                  'description' : 'You have posted on a social network about a book',
                  'price' : 5}
    
    def grantCheevo(self, cheevo, user_id):
        Achievement.objects.create(name=cheevo['name'], description=cheevo['description'],
                                    points=int(cheevo['points']), uid=user_id, notified=False)